﻿@page
@model DotNetStar.TheKing.Web.Pages.User.Setting.InformationModel

@{
    Layout = "_Layout";
    ViewBag.Title = $"完善个人信息";


}


<form method="post">
    @if (ModelState.ErrorCount > 0)
    {
        <div asp-validation-summary="All" class="alert alert-danger"></div>
    }
    @if (ViewData["Success"].To<bool>(false))
    {
        <div class="alert alert-success"><i class="fas fa-check-circle"></i> 提交成功</div>
    }
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">昵称</label>
            @(User.Identity.UserName())
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">金币</label>
            @Model.UserInfo.TradingPoints 个
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">等级</label>
            <div class="col-1">
                <span class="badge badge-primary">Lv. @Model.UserInfo.Level</span>
            </div>

        </div>
    </div>

    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">经验值</label>
            <div class="col-5 pt-1">
                <exp-pregress color="Success" exp="@Model.UserInfo.ExpPoints" exp-max="@Model.UserInfo.ExpMaxPoints" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label asp-for="Gender" class="col-2 text-right"></label>
            <select class="form-control col-1" asp-for="Gender" asp-items="@Html.GetEnumSelectItems<Infrastructure.Gender>()"></select>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label asp-for="TechExpYear" class="col-2 text-right"></label>
            <select class="form-control col-1" asp-for="TechExpYear">
                @foreach (var item in Enumerable.Range(0, 30))
                {
                    <option value="@item">@item</option>
                }
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">出生年月</label>
            <select class="form-control col-1" asp-for="Year">
                @foreach (var item in Enumerable.Range(1950, DateTime.Now.Year + 1 - 1950))
                {
                    <option value="@item">@item</option>
                }
            </select>
            <select class="form-control col-1" asp-for="Month">
                @foreach (var item in Enumerable.Range(1, 12))
                {
                    <option value="@item">@item</option>
                }
            </select>
            <select class="form-control col-1" asp-for="Day">
                @foreach (var item in Enumerable.Range(1, 31))
                {
                    <option value="@item">@item</option>
                }
            </select>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">允许被邀请回答问题</label>
            <select class="form-control col-2" asp-for="AllowInvite">
                <option value="true">是</option>
                <option value="false">否</option>
            </select>
            <small class="text-muted ml-3">是否允许作为提问时被邀请的对象</small>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label class="col-2 text-right">邀请身价(金币)</label>
            <input class="form-control col-2" min="1" max="50" asp-for="InviteCost"  placeholder="设置1-50之间"/>
            <small class="text-muted ml-3">空表示无偿提供帮助。你可以设置自己的邀请身价，当对方邀请你时会支付你相应金币</small>
        </div>
    </div>
    <div class="form-group">
        <div class="row">
            <label asp-for="Signature" class="col-2 text-right"></label>
            <textarea asp-for="Signature" class="form-control col-4" rows="5"></textarea>
        </div>
    </div>
    <div class="form-group">
        <button class="btn btn-primary w-25 offset-1" type="submit"><i class="fas fa-check"></i> 提 交</button>
    </div>
</form>
